package model;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;

import view.BoundBox;


public class DrawRect extends DrawObject 
{

	public DrawRect(String tmpL) 
	{
		String [] param = tmpL.split(" ");
		
		this.type =  param[0].charAt(0);
		
		this.setX1( new Integer(param[1]) );
		this.setY1( new Integer(param[2]) );
		
		this.setWidth( new Integer(param[3]) );
		this.setHeight( new Integer(param[4]) );
		
		this.x2 = this.x1 + this.width - 1;
		this.y2 = this.y1;
		
		this.x3 = this.x1 + this.width - 1;
		this.y3 = this.y1 + this.height -1;
		
		this.x4 = this.x1;
		this.y4 = this.y1 + this.height -1;
		
		this.setThickness( new Integer(param[5]) );
		
		this.setRed( new Integer(param[6]) );
		this.setGreen( new Integer(param[7]) );
		this.setBlue( new Integer(param[8]) );		
	}
	

	public DrawRect(DrawObject obj)
	{
		super (obj);
	}


	@Override
	public String toString()
	{
		String tmp = new String();
		
		tmp = 			this.type 
				+ " " + this.getX1()
				+ " " + this.getY1()
				+ " " + this.getWidth()
				+ " " + this.getHeight()
				+ " " + this.getThickness()
				+ " " + this.getRed()
				+ " " + this.getGreen()
				+ " " + this.getBlue();
		
		return tmp;
	}


}
